<extend name="Public/base" />

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>充值订单列表[{$_total}]</h2>
	</div>
	<div class="cf">
        <!-- 高级搜索 -->
		<div class="search-form cf fr">
			<div class="sleft">
				<div class="drop-down">
					<span id="sch-sort-txt" class="sort-txt" data="{:I('status')}"><if condition="$Think.get.status eq ''">所有<else/>{$Think.get.status|getStatus='short_order',###}</if></span>
					<i class="arrow arrow-down"></i>
					<ul id="sub-sch-menu" class="nav-list hidden">
						<li><a href="javascript:;" value="">所有</a></li>
						<volist name=":getStatus('payment')" id="val" key="key">
							<li><a href="javascript:;" value="{$key-1}">{$val}</a></li>
						</volist>
					</ul>
				</div>
				<input type="text" name="username" autocomplete="off" class="search-input" value="{:I('username')}" placeholder="请输入用户编号或用户名">
				<a class="sch-btn" href="javascript:;" id="search" url="{:U('Order/payment', false)}"><i class="btn-search"></i></a>
			</div>
		</div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
	<table class="">
    <thead>
        <tr>
		<th class="">订单号</th>
		<th class="">充值会员</th>
		<th class="">下单时间</th>
		<th class="">充值方式</th>
		<th class="">充值金额</th>
		<th class="">订单状态</th>
		</tr>
    </thead>
    <tbody>
		<notempty name="_list">
		<volist name="_list" id="vo">
		<tr>
			<td>{$vo.order_no}</td>
			<td>{$vo.uid|get_username}</td>
			<td>{$vo.create_time|time_format}</td>
			<td>{$vo.payment_code|get_table_field=###,'code', 'title', 'payment'}</td>
			<td>{$vo.price}</td>
			<td>{$vo.status_text}</td>
		</tr>
		</volist>
		<else/>
		<td colspan="6" class="text-center"> aOh! 暂时还没有内容! </td>
		</notempty>
	</tbody>
    </table>
	</div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
	<script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
	<script type="text/javascript">
	$(function(){
		//搜索功能
		$("#search").click(function(){
			var url = $(this).attr('url');
			var status = $("#sch-sort-txt").attr("data");
	        var query  = $('.search-form').find('input').serialize();
	        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
	        query = query.replace(/^&/g,'');
			if(status != ''){
				query = 'status=' + status + "&" + query;
	        }
	        if( url.indexOf('?')>0 ){
	            url += '&' + query;
	        }else{
	            url += '?' + query;
	        }
			window.location.href = url;
		});
		
	    //回车自动提交
	    $('.search-form').find('input').keyup(function(event){
	        if(event.keyCode===13){
	            $("#search").click();
	        }
	    });
	    
	    /* 状态搜索子菜单 */
		$(".search-form").find(".drop-down").hover(function(){
			$("#sub-sch-menu").removeClass("hidden");
		},function(){
			$("#sub-sch-menu").addClass("hidden");
		});
		$("#sub-sch-menu li").find("a").each(function(){
			$(this).click(function(){
				var text = $(this).text();
				$("#sch-sort-txt").text(text).attr("data",$(this).attr("value"));
				$("#sub-sch-menu").addClass("hidden");
			})
		});
	    
	    //导航高亮
        highlight_subnav('{:U('Order/payment')}');
	})
	</script>
</block>
